# -*- codeing =utf-8 -*-
# @Time : 2022/9/115 下午9:40
# @Author :WXJ
# @File : 4.6.py
# @Software: PyCharm
import random
zong = open("总名单.txt", "r", encoding="UTF-8")
all = zong.read()
namelist = all.split('\n')
s = len(namelist)
sed = 0
remain = 0
print("-----计科1813、1814总人数:%d-----" % s)
x = '1'
while x == '1':
    temp = random.choice(namelist)
    namelist.remove(temp)
    print("随机点名中:%s" % (temp))
    sed += 1
    remain = s - sed
    print("已随机点名人数：%d,未点到的人数：%d" % (sed, remain))

    f=open("新名单.txt", "w", encoding="UTF-8")
    for line in namelist:
        f.write(line+'\n')
    f.close()

    if not namelist:
        print("点名结束")
        break
    else:
            print("-"*31)
            x = input("是否继续点名[1继续/0结束]")
            while x != '1' and x != '0':
                x = input("请输入正确选项[0/1]")